package com.LeetCode;

public class _9_main {
	public static boolean isPalindrome(int x) {

		if (x < 0)
			return false;
		if (x < 10)
			return true;
		if (x % 10 == 0) {
			return false;
		}
		int weishu = 1;
		int number = x;
		while (number>=10) {
			number = number / 10;
			weishu++;
		}
		int xixi = 1;
		while (weishu > 1) {
			weishu--;
			xixi *= 10;
		}
		
		int haha = 10;
		int left = 0;
		int right = 0;
		while (xixi>=10) {
			left = x / xixi;
			right = x % haha;
			if (left != right) {
				return false;
			}
			x = x % xixi;
			x = x / 10;
			xixi = xixi / 100;
			if (xixi == 1)
				break;
		}
		return true;
	}

	public static void main(String[] args) {
		System.out.println(isPalindrome(1000030001));
	}
}
